package com.xzan.medusa.core.manager.impl;

import com.xzan.medusa.common.query.PageResult;
import com.xzan.medusa.dal.model.ActHiInvestmentDO;
import com.xzan.medusa.dal.query.ActHiInvestmentQuery;
import com.xzan.medusa.dal.mapper.ext.ActHiInvestmentExtMapper;
import com.xzan.medusa.core.manager.ActHiInvestmentManager;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;


/**
 * Manager for ActHiInvestment.
 */

@Component
public class ActHiInvestmentManagerImpl implements ActHiInvestmentManager{

    
    @Autowired
    protected ActHiInvestmentExtMapper actHiInvestmentExtMapper;
    /**
     * query count by query condition.
     */
    @Override
    public int countByQuery(ActHiInvestmentQuery query){
        return actHiInvestmentExtMapper.countByQuery(query);
    }

    /**
     * delete by query condition.
     */
    @Override
    public int deleteByQuery(ActHiInvestmentQuery query){
        return actHiInvestmentExtMapper.deleteByQuery(query);
    }

    /**
     * delete by primary key.
     */
    @Override
    public int deleteByPrimaryKey(ActHiInvestmentDO record){
        return actHiInvestmentExtMapper.deleteByPrimaryKey(record);
    }

    /**
     * insert selective.
     */
    @Override
    public long insertSelective(ActHiInvestmentDO record){
        return actHiInvestmentExtMapper.insertSelective(record);
    }

    /**
     * insert selective.
     */
    @Override
    public int batchInsert(List<ActHiInvestmentDO> records){
        return actHiInvestmentExtMapper.batchInsert(records);
    }

    /**
     * select by query condition.
     */
    @Override
    public List<ActHiInvestmentDO> selectByQuery(ActHiInvestmentQuery query){
        return actHiInvestmentExtMapper.selectByQuery(query);
    }

    /**
     * select by query condition with page.
    */
    @Override
    public PageResult<ActHiInvestmentDO> selectByQueryWithPage(ActHiInvestmentQuery query) {
        PageResult<ActHiInvestmentDO> result = new PageResult<ActHiInvestmentDO>();
        result.setPageSize(query.getPageSize());
        result.setPageNo(query.getPageNo());
        result.setTotalCount(this.countByQuery(query));
        result.setResult(this.selectByQuery(query));
        return result;
    }

    /**
     * select by primary key.
     */
    @Override
    public ActHiInvestmentDO selectByPrimaryKey(Long id){
        return actHiInvestmentExtMapper.selectByPrimaryKey(id);
    }

    /**
     * update by query condition selective.
     */
    @Override
    public int updateByQuerySelective( ActHiInvestmentDO record,  ActHiInvestmentQuery query){
        return actHiInvestmentExtMapper.updateByQuerySelective(record,  query);
    }

    /**
     * update by query condition.
     */
    @Override
    public int updateByQuery( ActHiInvestmentDO record,  ActHiInvestmentQuery query){

        return actHiInvestmentExtMapper.updateByQuery(record, query);
    }

    /**
     * update by primary key selective.
     */
    @Override
    public int updateByPrimaryKeySelective(ActHiInvestmentDO record){
        return actHiInvestmentExtMapper.updateByPrimaryKeySelective(record);
    }
}